import { Get, Inject, Provide } from '@midwayjs/decorator';
import { CreateApiDoc } from '@midwayjs/swagger';
import { CoolController, BaseController } from '@cool-midway/core';
import { WeiboTagsEntity } from '../../entity/tags';
import { WeiboTagsService } from '../../service/tags';
/**
 * 标签
 */
@Provide()
@CoolController(
  {
    api: ['info', 'list', 'page'],
    entity: WeiboTagsEntity,
  },
  { tagName: '话题', description: '话题' }
)
export class ApiWeiboTagsController extends BaseController {
  @Inject()
  weiboSrv: WeiboTagsService;

  @CreateApiDoc().summary('热门话题').respond(200).build()
  @Get('/hot')
  async hot() {
    return this.ok(await this.weiboSrv.hot(0, 20));
  }
}
